using System.Collections.Generic;
using System.Threading.Tasks;
using ERP.ProductionManage.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;

namespace ERP.ProductionManage
{
    /// <summary>
    /// 生产退料服务接口
    /// </summary>
    public interface IProductionReturnService : IApplicationService
    {
        /// <summary>
        /// 获取生产退料分页列表
        /// </summary>
        Task<PagedResultDto<ProductionReturnDto>> GetListAsync(GetProductionReturnInputDto input);

        /// <summary>
        /// 获取生产退料详情
        /// </summary>
        Task<ProductionReturnDto> GetAsync(int id);

        /// <summary>
        /// 创建生产退料
        /// </summary>
        Task<ProductionReturnDto> CreateAsync(CreateProductionReturnDto input);

        /// <summary>
        /// 更新生产退料
        /// </summary>
        Task<ProductionReturnDto> UpdateAsync(int id, UpdateProductionReturnDto input);

        /// <summary>
        /// 删除生产退料
        /// </summary>
        Task DeleteAsync(int id);

        /// <summary>
        /// 生成退料单编号
        /// </summary>
        Task<string> GenerateReturnCodeAsync();

        /// <summary>
        /// 获取退料明细列表
        /// </summary>
        Task<List<ProductionReturnDetailDto>> GetReturnDetailsAsync(int returnId);

        /// <summary>
        /// 添加退料明细
        /// </summary>
        Task<ProductionReturnDetailDto> CreateReturnDetailAsync(CreateProductionReturnDetailDto input);

        /// <summary>
        /// 删除退料明细
        /// </summary>
        Task DeleteReturnDetailAsync(int detailId);

        /// <summary>
        /// 执行退料操作（更新库存）
        /// </summary>
        Task ExecuteReturnAsync(int returnId);

        /// <summary>
        /// 获取仓库选择列表
        /// </summary>
        Task<List<WarehouseSelectDto>> GetWarehousesForSelectAsync();

        /// <summary>
        /// 获取物料选择列表（用于退料明细）
        /// </summary>
        /// <param name="input">查询条件</param>
        /// <returns>物料选择列表</returns>
        Task<PagedResultDto<MaterialSelectDto>> GetMaterialsForReturnAsync(GetProductSelectInputDto input);

        /// <summary>
        /// 获取生产工单选择列表
        /// </summary>
        /// <param name="input">查询条件</param>
        /// <returns>生产工单选择列表</returns>
        Task<PagedResultDto<WorkOrderSelectDto>> GetWorkOrdersForSelectAsync(GetWorkOrderSelectInputDto input);
    }
} 